package com.ck.core.constant;

/**
 * @author linqiang
 * @Description 系统配置名称枚举类
 * @date 2019-05-05 11:04
 */
public enum SysConfigNameEnum {

    PASS_PICTURE_SUFFIX("素材允许上传的图片后缀", "pass_picture_suffix"),
    PASS_VIDEO_SUFFIX("素材允许上传的视频后缀", "pass_video_suffix"),
    UPLOAD_MAX_PICTURE_SIZE("素材限制上传图片大小", "upload_max_picture_size",CharConstant.NUMBER),
    UPLOAD_MAX_VIDEO_SIZE("素材限制上传视频大小", "upload_max_video_size",CharConstant.NUMBER),
    PICTURE_COMPRESS_SIZE("素材图片压缩限制大小", "picture_compress_size",CharConstant.NUMBER),
    PICTURE_COMPRESS_DEFAULT_SUFFIX("素材图片默认压缩后的后缀类型", "picture_compress_default_suffix"),
    DEFAULT_WEB_IMAGE("素材网页默认展示图片", "default_web_image", CharConstant.FILE),
    FILE_GROUP_QUANTITY("素材分组最大数量", "file_group_quantity",CharConstant.NUMBER),
    NEED_AUTH_PROGRAM("是否需要审核节目", "need_auth_program",CharConstant.BOOLEAN),
    ALLOW_SUCCESS_PUSH_LATEST_TIME("允许最晚发送成功时间（终端开始调用下载接口，单位:小时）", "allow_success_push_latest_time", CharConstant.NUMBER),
    UPLOAD_APK_SUFFIX("上传的apk文件格式","upload_apk_suffix"),
    DEVICE_UPGRADE_TIMEOUT("升级超时时间","device_upgrade_timeout"),
    LOGO_URL("logo地址","logo_url", CharConstant.FILE),
    PLATFORM_NAME("系统（平台）名称","platform_name"),
    BOOT_TIME_DIFF("定时开关机区分工作日与周末","boot_time_diff", CharConstant.BOOLEAN),
    DEVICE_NO_PROGRAM_COUNTDOWN_TIME("设备空刊状态判定时间(小时)","device_no_program_countdown_time", CharConstant.NUMBER),
    GAME_URL("游戏地址","game_url"),
    GOODS_SHELVES("货架地址","goods_shelves"),
    PROGRAM_ONLINE_ALARM("上线提醒时间","program_online_alarm"),
    PROGRAM_OFFLINE_ALARM("下线提醒时间","program_offline_alarm"),
    ;
    /** 配置描述信息 */
    private String desc;
    /** 配置项 */
    private String type;
    /** 接收配置的类型：数字、字符、BOOLEAN、文件（URL） */
    private String accept;

    SysConfigNameEnum(String desc, String type) {
        this.desc = desc;
        this.type = type;
        this.accept = CharConstant.STRING;
    }

    SysConfigNameEnum(String desc, String type,String accept) {
        this.desc = desc;
        this.type = type;
        this.accept = accept;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static SysConfigNameEnum getByType(String type) {
        for (SysConfigNameEnum sysConfigNameEnum : SysConfigNameEnum.values()) {
            if ( sysConfigNameEnum.getType().equals(type) ) {
                return sysConfigNameEnum;
            }
        }
        return null;
    }

    public String getAccept() {
        return accept;
    }

}
